package com.qu.waibao.utils;

import android.text.TextUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Administrator on 2018/7/31.
 */

public class TimeUtil {
    public static long getUnitx(String indate) {
        long unitxs = 0;
        if(TextUtils.isEmpty(indate)){
            return 0;
        }
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = format.parse(indate);
            long unitx = date.getTime();
            long cutrrntTime = System.currentTimeMillis();
            unitxs = unitx - cutrrntTime;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return unitxs;
    }
}
